package com.cloud.springbootcloud.service;

import com.cloud.springbootcloud.pojo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient("service-provider")
public interface ProductService {

    @GetMapping("/product/list")
    public List<Product> getProductList();

    @GetMapping("/product/{id}")
    public Product selectProductById(@PathVariable("id") Integer id);

    @PostMapping("/product/single")
    public Product queryProductById(@RequestBody Integer id);

    @PostMapping("/product/save")
    Map<Object,Object> createProduct(@RequestBody Product product);
}